<template>
  <TbTitle level="2" title="（四）、理事会、监事成员情况" />
  <table border="0" class="m-table">
    <tr>
      <td rowspan="2">序号</td>
      <td rowspan="2">姓名</td>
      <td rowspan="2">类型</td>
      <td rowspan="2">年龄</td>
      <td rowspan="2">任社会组织职务</td>
      <td colspan="3">工作单位（原工作单位）及职务</td>
      <td rowspan="2">政治面貌</td>
      <td rowspan="2">是否为党政机关领导干部兼职</td>
      <td rowspan="2">手机号码</td>
      <td rowspan="2">职级</td>
      <td rowspan="2">是否退离休</td>
    </tr>
    <tr>
      <td>工作单位名称</td>
      <td>具体职务</td>
      <td>是否为法定代表人</td>
    </tr>
    <tr v-for="(item, index) in detailInfo">
      <td>{{ index - 0 + 1 }}</td>
      <td>{{ item.directorName }}</td>
      <td>{{ item.directorType == 6?'理事':item.directorType == 8?'监事':'其他' }}</td>
      <td>{{ item.directorAge }}</td>
      <td>{{ item.directorPositionType }}</td>
      <td>{{ item.directorUnitPosition }}</td>
      <td>{{ item.directorPositionName }}</td>
      <td>{{ yesNoBool(item.legalRepresentative) }}</td>
      <td>{{ dictToVal(dict1, item.directorPolitics) }}</td>
      <td>{{ yesNoBool(item.leadingCadres) }}</td>
      <td>{{ item.directorPhone }}</td>
      <td>{{ item.positionLevel }}</td>
      <td>{{ yesNoBool(item.isRetire) }}</td>
    </tr>
  </table>
  <div class="msg-tip">
  </div>
</template>

<script setup lang="ts">
import { ref, reactive, inject } from 'vue'
import TbTitle from '@/views/yearCheck/components/TbTitle.vue'
let detailInfo = reactive({})
const dict1 = ref([])
const { getDetailInfo } = inject('getDetailInfo')
import { getDictPolitics } from '@/api/dict/index'


let getDictInfo = () => {
  //政治面貌
  getDictPolitics().then(res => {
    dict1.value = res.data
  })
}

const dictToVal = (dictList, val) => {
  for (let i = 0; i < dictList.length; i++) {
    if (val == dictList[i].id) {
      return dictList[i].name
    }
  }
}
getDictInfo()
getDetailInfo().then(res => {
  Object.assign(detailInfo, res.data)
})

const yesNoBool = (val) => {
  return (val - 0) == 1 ? '是' : (val - 0) == 2 ? '否' : '否'
}
</script>
<style lang="scss" scoped>
.msg-tip {
  padding: 20px 0;
  color: #000;

  font-family: '微软雅黑';
}
</style>
